﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DailyRssDownload.Lib {
	[Serializable]
	public class AtomFeedCollection : List<AtomFeed> {
		public AtomFeedCollection() : base() { }
		
		public AtomFeedCollection(IEnumerable<AtomFeed> lstFeeds) : base(lstFeeds) { }

		public AtomFeedCollection(int intCapacity) : base(intCapacity) { }

		public static AtomFeedCollection GetAtomFeedsFromFeedCollection(FeedCollection objFeedCollection) {
			if (objFeedCollection == null) return new AtomFeedCollection();

			IEnumerable<AtomFeed> lstAtomFeeds = from item in objFeedCollection
												 where item is AtomFeed
												 select item as AtomFeed;

			return new AtomFeedCollection(lstAtomFeeds);
		}
	}
}
